package com.twu.biblioteca.model;

import java.util.ArrayList;
import java.util.List;

public class BibliotecaUser {
    private List<BibliotecaBook> books;
    private List<BibliotecaMovie> movies;
    private String userName;
    private String password;
    private String number;
    private String email;
    private String phoneNumber;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BibliotecaUser user = (BibliotecaUser) o;

        if (number != null ? !number.equals(user.number) : user.number != null) return false;
        if (password != null ? !password.equals(user.password) : user.password != null) return false;
        if (userName != null ? !userName.equals(user.userName) : user.userName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = userName != null ? userName.hashCode() : 0;
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (number != null ? number.hashCode() : 0);
        return result;
    }

    public BibliotecaUser() {
        this.books = new ArrayList<BibliotecaBook>();
        this.movies = new ArrayList<BibliotecaMovie>();
    }

    public List<BibliotecaBook> getBooks() {
        return books;
    }

    public void addBook(BibliotecaBook book) {
        books.add(book);
    }

    public List<BibliotecaMovie> getMovies() {
        return movies;
    }

    public void addMovie(BibliotecaMovie movie) {
        movies.add(movie);
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getPassword() {
        return password;
    }

    public String getUserName() {
        return userName;
    }

    public String getNumber() {
        return number;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getEmail() {
        return email;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }
}
